package com.example.wnn.develop.other;

import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;

public class ReadLocalFile2 {

   public  static   String content = "YX0000300657775,YX0000300657773,YX0000300657771,YX0000300657779,YX0000300657778,YX0000300657777";
   public  static   Integer rechargeid =3835;

    public static void main(String[] args) throws IOException {

        List<String>  sukList = Arrays.asList(content.split(","));
        System.out.println("INSERT INTO sx_recharge_limit (id,rechargeid,goodssku,limitnumbers,vstatus,crtime) VALUES");

        for (int i = 0; i < sukList.size(); i++) {
            String base = "('%s',%s,'%s',0,100,now())%s";
            String uuid= UUID.randomUUID().toString().replace("-","");
            String endOf = sukList.size()-1==i?";":",";
            String sqlStr = String.format(base, uuid,rechargeid,sukList.get(i),endOf);

            System.out.println(sqlStr);
        }

    }
}
